<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>订单管理</title>
{{--    引入bootstrap美化样式：--}}
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
<div style="width: 1000px;margin: 0 auto;padding: 30px">
    <form action="">
        <input type="text" class="form-control" style="width: 300px;float: left" placeholder="订单编号">
    </form>
</div>
<div>
    <table class="table table-bordered" width="1000px" >
         <tr style="font-weight: bold;text-align: center">
             <td>订单编号</td>
             <td>商品信息</td>
             <td>用户姓名</td>
             <td>用户手机号</td>
             <td>用户地址</td>
             <td>订单状态</td>
             <td>应付金额</td>
             <td>优惠金额</td>
             <td>实付金额</td>
             <td>支付渠道</td>
             <td>订单生成时间</td>
             <td>结算时间</td>
             <td><button>删除</button></td>
         </tr>
         @foreach($info as $v)
            <tr>
                <td>{{$v['order_sn']}}</td>
                <td>
                    <table>
                        <tr>
                            <td>店铺名称</td>
                            <td>商品名称</td>
                            <td>商品图片</td>
                            <td>商品价格</td>
                            <td>商品数量</td>
                            <td>商品总价</td>
                        </tr>
                        @foreach($v['shop_info'] as $val)
                            <tr>
                                <td>{{$val['store_num']}}</td>
                                <td>{{$val['goods_id']}}</td>
                                <td>{{$val['shop_img']}}</td>
                                <td>{{$val['goods_price']}}</td>
                                <td>{{$val['goods_number']}}</td>
                                <td>{{$val['goods_price']*$val['goods_number']}}</td>
                            </tr>
                        @endforeach
                    </table>
                </td>
                <td>{{$v['delivery_name']}}</td>
                <td>{{$v['delivery_tel']}}</td>
                <td>{{$v['delivery_address']}}</td>
                <td class="order_status" ids="{{$v['order_status']}}">{{$v['order_status']}}</td>
                <td>{{$v['order_total']}}</td>
                <td>{{$v['discount_value']}}</td>
                <td>{{$v['order_amount_total']}}</td>
                <td>{{$v['pay_channel']}}</td>
                <td>{{$v['created_at']}}</td>
                <td>{{$v['order_settlement_time']}}</td>
                <td><button>删除</button></td>
            </tr>
        @endforeach
    </table>
</div>
<div style="width: 300px;margin-right: 100px;float: right">{{$info->links()}}</div>
</body>
{{--引入jquery线上版本：--}}
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
    $(function () {
      $('body').ready(function () {
         $.each($('.order_status'),function () {
             if($(this).text()==1){
                 $(this).html('已付款')
             }
             if($(this).text()==0){
                 $(this).html('待付款')
             }
             if($(this).text()==2){
                 $(this).html('待发货')
             }
             if($(this).text()==3){
                 $(this).html('待收货')
             }
             if($(this).text()==4){
                 $(this).html('已完成')
             }
             if($(this).text()==5){
                 $(this).html('已取消')
             }
             if($(this).text()==6){
                 $(this).html('待评论')
             }
         })
      })
    })
</script>
</html>
